<template>
  <div class="not-found">
    <img src="https://img1.baidu.com/it/u=2662682505,1738248369&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" alt="404">
    <h2>页面不存在</h2>
    <p>您访问的页面可能已被删除或移动</p>
    <router-link to="/" class="back-btn">返回首页</router-link>
  </div>
</template>

<script>
export default {
  name: 'NotFound',
  mounted () {
    // 3秒后自动跳转到根路径（路由会自动重定向到合适页面）
    setTimeout(() => {
      this.$router.push('/')
    }, 3000)
  }
}
</script>

<style scoped>
.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    background-color: #f5f5f5;
}

img {
    width: 20rem;
    height: 20rem;
    margin-bottom: 2rem;
}

h2 {
    color: #333;
    margin-bottom: 1rem;
}

p {
    color: #666;
    margin-bottom: 2rem;
}

.back-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #1865ad;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.back-btn:hover {
    background-color: #0e6cb9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
</style>
